package com.wtp.wallpaper.rabbitmq.producer;

import com.wtp.wallpaper.pojo.dto.ScoreDTO;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RatingProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

//    public void sendRatingMessage(ScoreDTO scoreDTO) {
//        // 发送消息到 RabbitMQ 交换机
//        rabbitTemplate.convertAndSend("rating.exchange", "rating.routing.key", scoreDTO);
//    }

    public void sendRatingMessage(String scoreDTOStr) {
        // 发送消息到 RabbitMQ 交换机
        rabbitTemplate.convertAndSend("rating.exchange", "rating.routing.key", scoreDTOStr);
    }
}
